IE11: Fix incorrect node order with conditionals and text nodes#4650
Open
deadem wants to merge 2 commits intopreactjs:mainfrom
Open
IE11: Fix incorrect node order with conditionals and text nodes#4650deadem wants to merge 2 commits intopreactjs:mainfrom
deadem wants to merge 2 commits intopreactjs:mainfrom
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
Contributor
Author
|
Wow! There is already a hack: Line 42 in 3ff5f50 |
| return oldDom; | ||
| } else if (parentVNode._dom != oldDom) { | ||
| if (oldDom && parentVNode.type && !parentDom.contains(oldDom)) { | ||
| if (oldDom && parentVNode.type && !contains(parentDom, oldDom)) { |
Member
There was a problem hiding this comment.
I think we could solve this a lot simpler, similar to #4666 - alternatively, we could check whether oldDom is in fact a DOM-node rather than a text-node.
| parentNode: container, | ||
| childNodes: [], | ||
| contains: () => true, | ||
| isPortal: true, |
Member
There was a problem hiding this comment.
This is an unsafe change as other faux roots could be using this, also contains is not a hack, it's a DOM built-in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is an issue with using Element.contains in IE11. IE11 only partially supports contains: it works for Element nodes but does not support Text nodes. This can cause incorrect node ordering when conditionally rendering elements that include text nodes.
Minimal Repro:
Expected output:
Actual output in IE11: